class ApiException(Exception):
    """
    Generic Exception

    Parameters:

        message: str The error message
        amzn_code: str Amazon Error Code
        error: list Amazon Error list

    """
    code = 999

    def __init__(self, error, error_text=None):
        try:
            self.message = error.get('message')
            self.code = error.get('code')
        except IndexError:
            pass
        self.error = error
        if error is None:
            self.message = error_text

